package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysBillingMonthMapper;
import com.ruoyi.system.domain.SysBillingMonth;
import com.ruoyi.system.service.ISysBillingMonthService;

/**
 * 月账单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Service
public class SysBillingMonthServiceImpl implements ISysBillingMonthService 
{
    @Autowired
    private SysBillingMonthMapper sysBillingMonthMapper;

    /**
     * 查询月账单
     * 
     * @param billingId 月账单主键
     * @return 月账单
     */
    @Override
    public SysBillingMonth selectSysBillingMonthByBillingId(Long billingId)
    {
        return sysBillingMonthMapper.selectSysBillingMonthByBillingId(billingId);
    }

    /**
     * 查询月账单列表
     * 
     * @param sysBillingMonth 月账单
     * @return 月账单
     */
    @Override
    public List<SysBillingMonth> selectSysBillingMonthList(SysBillingMonth sysBillingMonth)
    {
        return sysBillingMonthMapper.selectSysBillingMonthList(sysBillingMonth);
    }

    /**
     * 新增月账单
     * 
     * @param sysBillingMonth 月账单
     * @return 结果
     */
    @Override
    public int insertSysBillingMonth(SysBillingMonth sysBillingMonth)
    {
        sysBillingMonth.setCreateTime(DateUtils.getNowDate());
        return sysBillingMonthMapper.insertSysBillingMonth(sysBillingMonth);
    }

    /**
     * 修改月账单
     * 
     * @param sysBillingMonth 月账单
     * @return 结果
     */
    @Override
    public int updateSysBillingMonth(SysBillingMonth sysBillingMonth)
    {
        return sysBillingMonthMapper.updateSysBillingMonth(sysBillingMonth);
    }

    /**
     * 批量删除月账单
     * 
     * @param billingIds 需要删除的月账单主键
     * @return 结果
     */
    @Override
    public int deleteSysBillingMonthByBillingIds(Long[] billingIds)
    {
        return sysBillingMonthMapper.deleteSysBillingMonthByBillingIds(billingIds);
    }

    /**
     * 删除月账单信息
     * 
     * @param billingId 月账单主键
     * @return 结果
     */
    @Override
    public int deleteSysBillingMonthByBillingId(Long billingId)
    {
        return sysBillingMonthMapper.deleteSysBillingMonthByBillingId(billingId);
    }
}
